﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HA.Data
{
    [Serializable]
    public class BoreholeCollection
    {

        public BoreholeCollection()
        {
            this.Borehole = new List<Borehole>();
        }

        private List<Borehole> _Borehole;

        public List<Borehole> Borehole
        {
            get { return _Borehole; }
            set { _Borehole = value; }
        }

        [field: NonSerialized]
        private event EventHandler<CollecionChangedEventArgs> CollectionChanged;

        public void Add(Borehole data)
        {
            this.Borehole .Add(data);

            if (this.CollectionChanged != null)
            {
                this.CollectionChanged(this, new CollecionChangedEventArgs(data, CollectionChangedType.ADD));

            }

        }

        public void Remove(Borehole data)
        {
            if (this.Borehole.Contains(data))
            {
                this.Borehole.Remove(data);

                if (this.CollectionChanged != null)
                {
                    this.CollectionChanged(this, new CollecionChangedEventArgs(data, CollectionChangedType.REMOVE));

                }

            }
        }
    }
}
